You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Support sequential domain reduction with mixed parameters - #633
A tuning problem can now use sequential domain reduction on a float parameter alongside integer and categorical choices. The transformer updates just the float bounds. It reads the incumbent by parameter name, so a categorical parameter with several encoded columns can precede the float. A minimum window can be specified for the float parameters alone. All-discrete spaces still raise at initialization.
On loading a checkpoint, the optimizer uses each parameter's encoded mask to restore changed bounds. This keeps the discrete parameter types intact. The regression exercises optimization and a save/load round trip with scalar, sequence and keyed minimum windows.
Linux validation passed all 193 tests, including the example notebooks. As an end-to-end check, a random forest was tuned over a continuous sampling fraction, integer depth and categorical split criterion on scikit-learn's breast cancer dataset. The fraction range narrowed from [0.2, 1.0] to [0.2, 0.450], the discrete domains were preserved, and all seven recorded AUCs reproduced on re-evaluation.
Codex assisted with the implementation and tests.
Summary by CodeRabbit
New Features
Domain reduction now works with mixed parameter types, narrowing float ranges while preserving integer and categorical ranges.
Minimum window sizes can be configured with a single value or values matched to float parameters.
Bug Fixes
Restored optimization states now retain the correct transformed bounds, including when parameter ordering differs.
No actionable comments were generated in the recent review.
Walkthrough
The domain reduction transformer now reduces float parameter bounds in spaces that also contain integer or categorical parameters. State loading groups transformed bounds by parameter masks. Tests cover minimum window inputs, unchanged non-float bounds, and save/load behavior.
Changes: Mixed-parameter domain reduction
Layer / File(s)
Summary
Select and reduce float parameter bounds bayes_opt/domain_reduction.py, tests/test_seq_domain_red.py
The transformer selects float parameters for domain reduction and rejects initialization when none exist. minimum_window accepts a scalar, a sequence matching the float parameter count, or a mapping keyed by float parameter. Integer and categorical domains remain unchanged.
State loading groups encoded bounds by parameter masks and excludes bounds that match the current bounds. Tests check mixed-parameter bounds and maxima after save/load.
This change lets sequential domain reduction work with mixed float, integer and categorical parameters, and it is covered by new tests, including save/load. No merge-blocking risk was identified.
Pre-merge checks: 4
Check name
Status
Explanation
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Title check
The title states the main change: sequential domain reduction now supports mixed parameter spaces (float, integer, categorical). The raw summary shows the transformer now applies reduction only to Flo…
Linked Issues check
Issue #620 asks that domain reduction work when continuous and discrete parameters are combined. It suggests ignoring discrete parameters during reduction. At head, bayes_opt/domain_reduction.py colle…
Out of Scope Changes check
All changes described in the PR relate to #620. The domain_reduction.py change restricts reduction to float parameters and removes the rejection of mixed spaces. The minimum_window handling for float …
Full details: Title check
Explanation
The title states the main change: sequential domain reduction now supports mixed parameter spaces (float, integer, categorical). The raw summary shows the transformer now applies reduction only to FloatParameter entries and keeps other parameter domains unchanged, which matches the title. The title is short, specific, and does not mention unrelated work.
Full details: Linked Issues check
Explanation
Issue #620 asks that domain reduction work when continuous and discrete parameters are combined. It suggests ignoring discrete parameters during reduction. At head, bayes_opt/domain_reduction.py collects only FloatParameter keys in initialize(). It raises ValueError only when no float parameter exists, so mixed spaces are accepted. The _update() and transform() methods read the incumbent by these float keys and return bounds only for them. Integer and categorical parameters keep their original domains. The minimum_window input accepts a mapping keyed by float parameter, a sequence matching the float count, or a scalar. The AI-generated summary states that bayes_opt/bayesian_optimization.py _load_state_dict now restores changed bounds per parameter using encoded masks, and that tests/test_seq_domain_red.py covers mixed-parameter optimization and save/load. The domain_reduction.py behavior was read directly. The bayesian_optimization.py and test changes were not read, because diff and file reads for those changed blobs were unavailable; they rest on the summary. The end-to-end and CI claims in the PR description are not coding requirements and were not assessed.
Full details: Out of Scope Changes check
Explanation
All changes described in the PR relate to #620. The domain_reduction.py change restricts reduction to float parameters and removes the rejection of mixed spaces. The minimum_window handling for float parameters and the documentation update support that behavior. The bayesian_optimization.py change restores transformed float bounds on checkpoint load. This follows from the same float-only bounds design, so it is connected to the feature. The tests cover the new mixed-parameter behavior and the all-integer ValueError. No unrelated change was identified in the summaries. The bayesian_optimization.py and test file hunks were assessed from the AI-generated summary only, because their diffs were unavailable.
Finishing Touches
Generate unit tests (beta)
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
File: No configuration file from this repository applied
Commit: Unavailable
Layers: defaults
Review profile: CHILL
Plan: Advanced
Run ID: 5a4a889f-28fb-4d55-8f20-0f91d4648216
Commits
Reviewing files that changed from the base of the PR and between ec45123 and ba08eb5.
Files selected for processing: 3
bayes_opt/bayesian_optimization.py
bayes_opt/domain_reduction.py
tests/test_seq_domain_red.py
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.
This branch has not been deployed
No deployments
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #620.
A tuning problem can now use sequential domain reduction on a float parameter alongside integer and categorical choices. The transformer updates just the float bounds. It reads the incumbent by parameter name, so a categorical parameter with several encoded columns can precede the float. A minimum window can be specified for the float parameters alone. All-discrete spaces still raise at initialization.
On loading a checkpoint, the optimizer uses each parameter's encoded mask to restore changed bounds. This keeps the discrete parameter types intact. The regression exercises optimization and a save/load round trip with scalar, sequence and keyed minimum windows.
Linux validation passed all 193 tests, including the example notebooks. As an end-to-end check, a random forest was tuned over a continuous sampling fraction, integer depth and categorical split criterion on scikit-learn's breast cancer dataset. The fraction range narrowed from [0.2, 1.0] to [0.2, 0.450], the discrete domains were preserved, and all seven recorded AUCs reproduced on re-evaluation.
Codex assisted with the implementation and tests.
Summary by CodeRabbit